<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\LoginController;
use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\ProfileController;
use App\Http\Controllers\Admin\CategoryController;
use App\Http\Controllers\Admin\ArticlesController;
use App\Http\Controllers\Common\UeditorController;
use App\Http\Controllers\Common\UploadsController;
use App\Http\Controllers\Admin\WebsitesController;
use App\Http\Controllers\Admin\WebsitesTopicController;
use App\Http\Controllers\Admin\PictureController;
use App\Http\Controllers\Admin\AdministratorController;
use App\Http\Controllers\Admin\TasksController;
use App\Http\Controllers\Admin\BannersController;
use App\Http\Controllers\Admin\WebsitestyleController;
use App\Http\Controllers\Admin\WebsiteQuickController;


/*
|--------------------------------------------------------------------------
| admin Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
//编辑器
Route::controller(UeditorController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::any('/Ueditor/index', 'index')->name('admin.Ueditor.index');
});
//上传功能
Route::controller(UploadsController::class)->prefix('common')->middleware('auth.admin')->group(function () {
    Route::post('/upload/image', 'image')->name('upload.image');//上传图片
});
//登录功能
Route::controller(LoginController::class)->prefix('admin')->group(function () {
    Route::get('login', 'loginForm')->name('admin.loginForm'); //登陆展示
    Route::get("fagao",'fagaoLogin')->name('admin.fagaoLogin');//发稿登录
    Route::post('login', 'login')->name('admin.login'); //登陆接口
    Route::get('logout', 'logout')->name('admin.logout'); //退出
});
//栏目页
Route::controller(IndexController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/', 'layout')->name('admin.layout'); //布局
    Route::get('/control', 'control')->name('admin.index.control'); //控制台
});
//账号密码
Route::controller(ProfileController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/profile/pwd', 'pwd')->name('admin.profile.pwd'); //密码修改
    Route::put('/profile/store', 'store')->name('admin.profile.store'); //密码修改-保存
});
//关键字分类
Route::controller(CategoryController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
     Route::get('/category/index', 'index')->name('admin.category.index');
     Route::get('/category/listData', 'listData')->name('admin.category.listData');//分类列表数据
     Route::get('/category/createForm', 'createForm')->name('admin.category.createForm');//分类添加展示
     Route::post('/category/store', 'store')->name('admin.category.store');//分类添加保存
     Route::get('/category/editForm', 'editForm')->name('admin.category.editForm');//分类编辑展示
     Route::put('/category/update', 'update')->name('admin.category.update');//分类编辑保存
     Route::delete('/category/delete', 'delete')->name('admin.category.delete');//分类删除
     Route::post('/category/deleteAll', 'deleteAll')->name('admin.category.deleteAll');//分类批量删除
     Route::post('/category/release', 'release')->name('admin.category.release');//释放
     Route::get('/category/importExcel', 'importExcel')->name('admin.category.importExcel');//分类导入
     Route::post('/category/importExcelData', 'importExcelData')->name('admin.category.importExcelData');//分类导入
});
//文章内容
Route::controller(ArticlesController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/articles/index', 'index')->name('admin.articles.index');
    Route::get('/articles/listData', 'listData')->name('admin.articles.listData');//文章列表数据
    Route::get('/articles/createForm', 'createForm')->name('admin.articles.createForm');//添加展示
    Route::post('/articles/store', 'store')->name('admin.articles.store');//添加保存
    Route::post('/articles/content', 'content')->name('admin.articles.content');//文章标题内容
    Route::get('/articles/editForm', 'editForm')->name('admin.articles.editForm');//编辑展示
    Route::put('/articles/update', 'update')->name('admin.articles.update');//编辑保存
    Route::get('/articles/show', 'show')->name('admin.articles.show');//展示页面
    Route::get('/articles/thumbs', 'thumbs')->name('admin.articles.thumbs');//文章缩略图
    Route::delete('/articles/delete', 'delete')->name('admin.articles.delete');//文章删除
    Route::post('/articles/deleteAll', 'deleteAll')->name('admin.articles.deleteAll');//文章批量删除
    Route::post('/articles/release', 'release')->name('admin.articles.release');//释放
});
//网站管理
Route::controller(WebsitesController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/websites/index', 'index')->name('admin.websites.index');
    Route::get('/websites/listData', 'listData')->name('admin.websites.listData');//列表数据
    Route::get('/websites/createForm', 'createForm')->name('admin.websites.createForm');//添加展示
    Route::post('/websites/store', 'store')->name('admin.websites.store');//添加保存
    Route::get('/websites/editForm', 'editForm')->name('admin.websites.editForm');//编辑展示
    Route::put('/websites/update', 'update')->name('admin.websites.update');//编辑保存
    Route::post('/websites/status', 'status')->name('admin.websites.status');//状态修改
    Route::delete('/websites/delete', 'delete')->name('admin.websites.delete');//删除
});
//栏目管理
Route::controller(WebsitesTopicController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/websitesTopic/index', 'index')->name('admin.websitesTopic.index');
    Route::get('/websitesTopic/listData', 'listData')->name('admin.websitesTopic.listData');//列表数据
    Route::get('/websitesTopic/createForm', 'createForm')->name('admin.websitesTopic.createForm');//添加展示
    Route::post('/websitesTopic/store', 'store')->name('admin.websitesTopic.store');//添加保存
    Route::get('/websitesTopic/editForm', 'editForm')->name('admin.websitesTopic.editForm');//编辑展示
    Route::put('/websitesTopic/update', 'update')->name('admin.websitesTopic.update');//编辑保存
    Route::post('/websitesTopic/status', 'status')->name('admin.websitesTopic.status');//状态修改
    Route::delete('/websitesTopic/delete', 'delete')->name('admin.websitesTopic.delete');//删除
    Route::post('/websitesTopic/topicData', 'topicData')->name('admin.websitesTopic.topicData');//栏目
});
//图片管理
Route::controller(PictureController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/picture/index', 'index')->name('admin.picture.index');
    Route::get('/picture/listData', 'listData')->name('admin.picture.listData');//列表数据
    Route::get('/picture/createForm', 'createForm')->name('admin.picture.createForm');//添加展示
    Route::post('/picture/store', 'store')->name('admin.picture.store');//添加保存
    Route::get('/picture/editForm', 'editForm')->name('admin.picture.editForm');//编辑展示
    Route::put('/picture/update', 'update')->name('admin.picture.update');//编辑保存
    Route::delete('/picture/delete', 'delete')->name('admin.picture.delete');//删除
    Route::post('/picture/deleteAll', 'deleteAll')->name('admin.picture.deleteAll');//批量删除
});
//管理员管理
Route::controller(AdministratorController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/administrator/index', 'index')->name('admin.administrator.index');
    Route::get('/administrator/listData', 'listData')->name('admin.administrator.listData');//列表数据
    Route::get('/administrator/createForm', 'createForm')->name('admin.administrator.createForm');//添加展示
    Route::post('/administrator/store', 'store')->name('admin.administrator.store');//添加保存
    Route::get('/administrator/editForm', 'editForm')->name('admin.administrator.editForm');//编辑展示
    Route::put('/administrator/update', 'update')->name('admin.administrator.update');//编辑保存
    Route::post('/administrator/status', 'status')->name('admin.administrator.status');//状态修改
    Route::delete('/administrator/delete', 'delete')->name('admin.administrator.delete');//删除
    Route::post('/administrator/deleteAll', 'deleteAll')->name('admin.administrator.deleteAll');//批量删除
});

//任务管理
Route::controller(TasksController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/tasks/index', 'index')->name('admin.tasks.index');
    Route::get('/tasks/listData', 'listData')->name('admin.tasks.listData');//列表数据
    Route::get('/tasks/createForm', 'createForm')->name('admin.tasks.createForm');//添加展示
    Route::post('/tasks/store', 'store')->name('admin.tasks.store');//添加保存
    Route::get('/tasks/editForm', 'editForm')->name('admin.tasks.editForm');//编辑展示
    Route::put('/tasks/update', 'update')->name('admin.tasks.update');//编辑保存
    Route::post('/tasks/status', 'status')->name('admin.tasks.status');//状态修改
    Route::delete('/tasks/delete', 'delete')->name('admin.tasks.delete');//删除
    Route::post('/tasks/deleteAll', 'deleteAll')->name('admin.tasks.deleteAll');//批量删除
});

//轮播图管理
Route::controller(BannersController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/banners/index', 'index')->name('admin.banners.index');
    Route::get('/banners/listData', 'listData')->name('admin.banners.listData');//列表数据
    Route::get('/banners/createForm', 'createForm')->name('admin.banners.createForm');//添加展示
    Route::post('/banners/store', 'store')->name('admin.banners.store');//添加保存
    Route::get('/banners/editForm', 'editForm')->name('admin.banners.editForm');//编辑展示
    Route::put('/banners/update', 'update')->name('admin.banners.update');//编辑保存
    Route::post('/banners/status', 'status')->name('admin.banners.status');//状态修改
    Route::delete('/banners/delete', 'delete')->name('admin.banners.delete');//删除
    Route::post('/banners/deleteAll', 'deleteAll')->name('admin.banners.deleteAll');//批量删除
});

//轮播图管理
Route::controller(WebsitestyleController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/websitestyle/index', 'index')->name('admin.websitestyle.index');
    Route::get('/websitestyle/listData', 'listData')->name('admin.websitestyle.listData');//列表数据
    Route::get('/websitestyle/createForm', 'createForm')->name('admin.websitestyle.createForm');//添加展示
    Route::post('/websitestyle/store', 'store')->name('admin.websitestyle.store');//添加保存
    Route::get('/websitestyle/editForm', 'editForm')->name('admin.websitestyle.editForm');//编辑展示
    Route::put('/websitestyle/update', 'update')->name('admin.websitestyle.update');//编辑保存
    Route::post('/websitestyle/status', 'status')->name('admin.websitestyle.status');//状态修改
    Route::delete('/websitestyle/delete', 'delete')->name('admin.websitestyle.delete');//删除
    Route::get('/websitestyle/show', 'show')->name('admin.websitestyle.show');//查看
});

//快速连接
Route::controller(WebsiteQuickController::class)->prefix('admin')->middleware('auth.admin')->group(function () {
    Route::get('/websitequick/index', 'index')->name('admin.websitequick.index');
    Route::get('/websitequick/listData', 'listData')->name('admin.websitequick.listData');//列表数据
    Route::get('/websitequick/createForm', 'createForm')->name('admin.websitequick.createForm');//添加展示
    Route::post('/websitequick/store', 'store')->name('admin.websitequick.store');//添加保存
    Route::get('/websitequick/editForm', 'editForm')->name('admin.websitequick.editForm');//编辑展示
    Route::put('/websitequick/update', 'update')->name('admin.websitequick.update');//编辑保存
    Route::post('/websitequick/status', 'status')->name('admin.websitequick.status');//状态修改
    Route::delete('/websitequick/delete', 'delete')->name('admin.websitequick.delete');//删除
});



